package cn.kkcxy.blog.core.enums;

import lombok.Getter;

/**
 * @BelongsProject: kkcxy-blog
 * @BelongsPackage: cn.kkcxy.blog.core.enums
 * @Author: kkcxy
 * @CreateTime: 2024-09-24 01:56
 * @Description: 文章分类枚举
 * @Version: 1.0
 */
@Getter
public enum ArticleCategoryEnum {

    PRIMARY(1, "一级分类"),
    SECONDARY(2, "二级分类");

    private final Integer type;
    private final String message;

    ArticleCategoryEnum(Integer type, String message) {
        this.type = type;
        this.message = message;
    }

    public static ArticleCategoryEnum getByType(Integer type) {
        for (ArticleCategoryEnum articleCategoryEnum : ArticleCategoryEnum.values()) {
            if (articleCategoryEnum.getType().equals(type)) {
                return articleCategoryEnum;
            }
        }
        return null;
    }
}
